package com.levy.contronller.lamdaTest.time;

import org.joda.time.DateTime;
import org.joda.time.LocalDate;

public class JodaTimeTest {


    public static void main(String[] args) {

        String format = "yyyy-MM-dd";

        DateTime today = new DateTime();
        DateTime tomorrow = today.plusDays(1);

        System.out.println(today.toString(format));
        System.out.println(tomorrow.toString(format));

        DateTime dateTime = today.withDayOfMonth(1);
        System.out.println(dateTime.toString(format));

        LocalDate localDate = new LocalDate();
        System.out.println(localDate);

        LocalDate localDate1 = localDate.plusMonths(3).dayOfMonth().withMinimumValue();
        System.out.println(localDate1);

        DateTime d = new DateTime();
        DateTime d2 = d.minusYears(2).monthOfYear().setCopy(3).dayOfMonth().withMinimumValue();
        System.out.println(d2.toString(format));
    }


}
